const express = require('express')
const router = express.Router()
// 1.导入验证数据的中间件
const expressJoi = require('@escook/express-joi')
// 2.导入需要的验证规则对象
const { reg_wordBook_schema,reg_wordBook_collection } = require('../schema/wordBook')


// 导入路由处理函数
const userinfo_handler = require('../router_handler/wordBook')

// 获取单词本基本信息的路由
router.get('/wordBook', userinfo_handler.wordBook)

// 添加单词本的路由
router.post('/wordBookAdd', userinfo_handler.wordBookAdd)

// 删除单词本的路由
router.get('/deleteWordBook', expressJoi(reg_wordBook_schema),userinfo_handler.deleteWordBook)

// 收藏单词本的路由
router.post('/bookmarkWords', expressJoi(reg_wordBook_collection),userinfo_handler.bookmarkWords)

/* // 修改单词本的路由  (暂时弃用)
router.post('/modifyWordBook', userinfo_handler.modifyWordBook) */

// 向外共享路由对象
module.exports = router